import java.util.*;
/**
 * @Author: YCKOKO
 * @Date: 2023-05-11
 * @Time:14:08
 * @Description:
 */
public class demo1 {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        str = str + "a";
        int len = str.length();
        int max_len = 0;
        int start = 0;int end = 0;
        int i = 0;
        String ret = "";
        while(i < len){
            if(str.charAt(i) >= '0' && str.charAt(i) <= '9'){
                start = i;
                end = i;
                i++;
                while(i < len){
                    if(str.charAt(i) >= '0' && str.charAt(i) <= '9'){
                        end = i;
                    }else{
                        if(end - start + 1 > max_len){
                            max_len = end - start + 1;
                            ret = str.substring(start,end+1);
                        }
                        break;
                    }
                    i++;
                }
            }else{
                i++;
            }
        }
        System.out.println(ret);
    }
}

